import 'package:flutter/material.dart';
import 'package:flutter_project/tool/theme/app_theme.dart';
import 'package:flutter_project/tool/translations/language_manager.dart';
import 'package:flutter_project/tool/utils/app_colors.dart';
import 'package:get/get_utils/get_utils.dart';

class ThemeLanguageChange extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: Center(
          child: Column(
            children: [
              InkWell(
                onTap: () {
                  LanguageManager.changeLanguage(Language.zhTW);
                },
                child: Text('切换为繁体中文'.tr),
              ),
              const SizedBox(
                height: 20,
              ),
              InkWell(
                onTap: () {
                  // Get.updateLocale(Locale('zh', 'CN'));
                  LanguageManager.changeLanguage(Language.zhCN);
                },
                child: Text(
                  '切换为简体中文'.tr,
                ),
              ),
              const SizedBox(
                height: 20,
              ),
              InkWell(
                onTap: () {
                  LanguageManager.changeLanguage(Language.enUS);
                },
                child: Text('切换为英文'.tr),
              ),
              const SizedBox(
                height: 20,
              ),
              InkWell(
                onTap: () {
                  AppTheme.changeThemeDark();
                },
                child: const Text(
                  '切换深色主题',
                ),
              ),
              const SizedBox(
                height: 20,
              ),
              InkWell(
                onTap: () {
                  AppTheme.changeThemeLight();
                },
                child: const Text(
                  '切换浅色主题',
                ),
              ),
              const SizedBox(
                height: 20,
              ),
              Container(
                padding: const EdgeInsets.all(20),
                child: Text(
                  '测试文本'.tr,
                  style: TextStyle(color: APPColors.dRed_yellow()),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
